package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SinScoreMapper;
import com.ruoyi.system.domain.SinScore;
import com.ruoyi.system.service.ISinScoreService;

/**
 * 学生分值Service业务层处理
 *
 * @author buke
 * @date 2023-04-15
 */
@Service
public class SinScoreServiceImpl extends ServiceImpl<SinScoreMapper,SinScore> implements ISinScoreService
{
    @Autowired
    private SinScoreMapper sinScoreMapper;

    /**
     * 查询学生分值
     *
     * @param id 学生分值主键
     * @return 学生分值
     */
    @Override
    public SinScore selectSinScoreById(Long id)
    {
        return sinScoreMapper.selectSinScoreById(id);
    }

    /**
     * 查询学生分值列表
     *
     * @param sinScore 学生分值
     * @return 学生分值
     */
    @Override
    public List<SinScore> selectSinScoreList(SinScore sinScore)
    {
        return sinScoreMapper.selectSinScoreList(sinScore);
    }

    /**
     * 新增学生分值
     *
     * @param sinScore 学生分值
     * @return 结果
     */
    @Override
    public int insertSinScore(SinScore sinScore)
    {
        sinScore.setCreateTime(DateUtils.getNowDate());
        return sinScoreMapper.insertSinScore(sinScore);
    }

    /**
     * 修改学生分值
     *
     * @param sinScore 学生分值
     * @return 结果
     */
    @Override
    public int updateSinScore(SinScore sinScore)
    {
        sinScore.setUpdateTime(DateUtils.getNowDate());
        return sinScoreMapper.updateSinScore(sinScore);
    }

    /**
     * 批量删除学生分值
     *
     * @param ids 需要删除的学生分值主键
     * @return 结果
     */
    @Override
    public int deleteSinScoreByIds(Long[] ids)
    {
        return sinScoreMapper.deleteSinScoreByIds(ids);
    }

    /**
     * 删除学生分值信息
     *
     * @param id 学生分值主键
     * @return 结果
     */
    @Override
    public int deleteSinScoreById(Long id)
    {
        return sinScoreMapper.deleteSinScoreById(id);
    }
}
